package com.heima.admin.controller.v1;

import com.heima.admin.service.AdminUserService;
import com.heima.model.admin.dtos.AuthDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Psycho
 * @create 2022-05-02-16:29
 */
@RestController
@RequestMapping("/user/api/v1/auth")
public class AdminUserController {


    @Autowired
    private AdminUserService adminUserService;

    /**
     * 用户查询
     * @param dto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult listUsers(@RequestBody AuthDto dto){
        return adminUserService.listUsers(dto);
    }

    /**
     * 用户驳回
     * @param dto
     * @return
     */
    @PostMapping("/authFail")
    public ResponseResult fail(@RequestBody AuthDto dto){
        return adminUserService.fail(dto);
    }


    /**
     * 用户通过
     * @param dto
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult pass(@RequestBody AuthDto dto){
        return adminUserService.pass(dto);
    }
}
